home *** CD-ROM | disk | FTP | other *** search
- ; AutoExec Section is on top here. Actually runs before file manager
- ; appears on the screen
-
- TAB=num2char(9)
- CR=strcat(num2char(13),num2char(10))
- ; if !WinExist("Clock") then Run("Clock.exe","")
-
- Edit FM Extender menu
- a=FileLocate("wwwfmext.fme")
- adir=FilePath(a)
- DirChange(adir)
- aroot=FileRoot(a)
- bname=strcat(aroot,".BAK")
- FileCopy(a,bname,@FALSE)
- run("notepad.exe","wwwfmext.fme")
-
- _Bro&wse...
- l=CurrentFile()
- run("browser.exe",l)
- drop(a,l)
- &Edit...
- l=CurrentFile()
- ;if !IsKeyDown(@SHIFT) then l=askline("Edit","Enter file to edit",l)
- if l=="" || l==" " then goto NULL
- a=strscan(l,".\",0,@BACKSCAN)
- if a==0 then l=strcat(l,".")
- if a==0 then goto NULL
- if strsub(l,a,1)!="." then l=strcat(l,".")
- :NULL
- run("notepad.exe",strtrim(l))
- drop(a,b,l)
- Utilities
- &Freespace on Local Drives
-
- Drive=DiskScan(2) ; 2 is the code for local hard drives
- Dmax=strlen(Drive)
- DIndex=1
- TotalSize=0
- DriveReport=""
-
- :COUNTSPACE
- NextDrive=StrSub(Drive,Dindex,1)
- a=DiskFree(NextDrive)/1024
- TotalSize=a+TotalSize
- DriveReport=strcat(DriveReport,NextDrive," = ",a,"K","@")
- DIndex=Dindex+3 ;each entry is 3 bytes long
- if DIndex<=Dmax then goto COUNTSPACE
- ItemSelect("Total Space Available = %TotalSize%K",DriveReport,"@")
- Drop(xxx,TotalSize,DriveReport,NextDrive,LastDrive)
-
- &Wallpaper
- DirChange(dirWindows(0))
- a=FileItemize("*.BMP")
- a=strcat("-None- ",a)
- a=ItemSelect("Select New Wallpaper",a," ")
- terminate(a=="","Wallpaper","No wallpaper selected")
- if a=="-None-" then Wallpaper("",0)
- if a=="-None-" then exit
- tile=@FALSE
- if FileSize(a)<40000 then tile=@TRUE
- ;if bmp size less than 40K, assume tile, else center
- Wallpaper(a,tile)
- drop(a,b,tile)
- Edit &INI files
- DirChange(DirWindows(0))
- canned="BYEBYE"
- IniFiles=""
-
- :UP1
- canned="byebye"
- If IniFiles!="" then goto inied
- IniFiles=FileItemize("*.INI")
- :inied
- TheFile=ItemSelect("Choose Desired INI file",IniFiles," ")
- if TheFile=="" then goto newini
- Sections=""
-
- :UP2
- canned="up1"
- if Sections!="" then goto sected
- Sections=IniItemizePvt("",TheFile)
- :SECTED
- Section=ItemSelect("%TheFile% - Choose Section",Sections,TAB)
- if Section=="" then goto AddSect
- KeyValues=""
-
- :UP3
- canned="up2"
- if KeyValues!="" then goto looped
- Keys=IniItemizePvt(Section,TheFile)
- KeyMax=ItemCount(Keys,TAB)
- KeyIndex=0
-
- :Loop
- if KeyIndex==KeyMax then goto looped
- KeyIndex=KeyIndex+1
- ThisKey=ItemExtract(KeyIndex,Keys,TAB)
- ThisValue=IniReadPvt(Section,ThisKey,"???",TheFile)
- KeyValues=strcat(KeyValues,ThisKey,"= ",ThisValue,TAB)
- goto Loop
-
- :looped
- Key=ItemSelect("%TheFile% [%Section%] - Choose Keyword",KeyValues,TAB)
- if Key=="" then goto AddKey
- Key=ItemExtract(1,Key,"=")
-
- Value=IniReadPvt(Section,Key,"???",TheFile)
- goto entkey
-
-
- :newini
- canned="UP1"
- TheFile=Askline("Making NEW INI file","Enter new INI file name","*.INI")
- if (TheFile=="*.INI" || TheFile=="") then goto newini
- IniFIles=""
- goto AddSectNewIni
-
- :AddSect
- canned="up2"
- :AddSectNewIni
- Section=AskLine("Add New Section to INI File","Enter new section name for%CR% %TheFile%%CR% [?????]","")
- Sections=""
- goto AddKeyNewSect
-
- :AddKey
- canned="up3"
- :AddKeyNewSect
- Key=AskLine("Add New Keyword to INI File","Enter new key name for%CR% %TheFile%%CR% [%Section%]","")
- Value="(Undefined)"
- KeyValues=""
- goto EntKeyNewKey
-
- :ENTKEY
- canned="up3"
- :EntKeyNewkey
- NewValue=AskLine("Modify INI File Keyword","%TheFile%%CR% [%Section%]%CR% %Key% = %Value%",Value)
- if NewValue!=Value then iniwritepvt(Section,Key,NewValue,TheFile)
- KeyValues=""
- goto up3
-
- :CANCEL
- goto %Canned%
-
- :BYEBYE
- exit
-
- Clipboard Tricks
- Path and Filename to Clipboard
- Clipput(strcat(DirGet(),CurrentFile()))
- Copy &Directory to Clipboard
- a=FileItemize("*.*")
- a=StrReplace(a," ",cr)
- ClipPut(a)
- Drop(a)
- Copy &Hilited files to Clipboard
- a=FileItemize("")
- a=StrReplace(a," ",cr)
- ClipPut(a)
- Drop(a)
- Copy &Hilited dirs to Clipboard
- a=DirItemize("")
- a=StrReplace(a," ",cr)
- ClipPut(a)
- Drop(a)
- Copy &Special Characters to Clipboard
- a=" í| ó| ú| ñ| Ñ| ª| º| ¿| ⌐| ¬|" ;161 thru 170
- b=" ½| ¼| ¡| «| »| ░| ▒| ▓| │| ┤|" ;171 thru 180
- c=" ╡| ╢| ╖| ╕| ╣| ║| ╗| ╝| ╜| ╛|" ;181 thru 190
- d=" ┐| └| ┴| ┬| ├| ─| ┼| ╞| ╟| ╚|" ;191 thru 200
- e=" ╔| ╩| ╦| ╠| ═| ╬| ╧| ╨| ╤| ╥|" ;201 thru 210
- f=" ╙| ╘| ╒| ╓| ╫| ╪| ┘| ┌| █| ▄|" ;211 thru 220
- g=" ▌| ▐| ▀| α| ß| Γ| π| Σ| σ| µ|" ;221 thru 230
- h=" τ| Φ| Θ| Ω| δ| ∞| φ| ε| ∩| ≡|" ;231 thru 240
- i=" ±| ≥| ≤| ⌠| ⌡| ÷| ≈| °| ∙| ·|" ;241 thru 250
- j=" √| ⁿ| ²| ■| " ;251 thru 255
- a=strcat(a,b,c,d,e,f,g,h,i,j)
- Drop(b,c,d,e,f,g,h,i,j)
- a=ItemSelect("Choose a character",a,"|")
- a=strsub(a,2,1)
- ClipPut(a)
- Drop(a)
-
-
- Accessories
- Appointment Scheduling
- run("Calendar.exe","")
- Calculator
- run("calc.exe","")
-
- C&lipboard
- errormode(@off)
- terminate(winactivate("Clipboard"),"","") ;Already Running
- errormode(@cancel)
- run("Clipbrd.exe","")
-
- Clock
- run("clock.exe","")
-
- Control &Panel
- errormode(@off)
- terminate(winactivate("Control Panel"),"","")
- errormode(@cancel)
- run("control.exe","")
- Cardfile
- run("cardfile.exe","")
-
- Notepad Editor
- run("notepad.exe","")
-
- Paint
- run("pbrush.exe","")
-
- Write
- run("write.exe","")
-
- Run System Confi&guration Editor
- run("sysedit.exe","") ;takes care of itself
- Run Windows Setup
- DirChange(DirWindows(0))
- run("setup.exe","")
- drop(a)
- _PIF Edi&t...
- a=strupper(FileExtension(CurrentFile()))
- if a!="PIF" then goto PIF2
- run("pifedit.exe",CurrentFile())
- exit
- :PIF2
- if IsKeyDown(@SHIFT)==@YES then DirChange(FilePath(FileLocate("_default.pif")))
- a=FileItemize("*.PIF")
- if a=="" then DirChange(FilePath(FileLocate("_default.pif")))
- if a=="" then a=FileItemize("*.PIF")
- a=ItemSelect("Choose a PIF File to edit",a," ")
- run("pifedit.exe",a)
- exit
- _&System Information
- wintype="retail"
- if WinMetrics(22) then wintype="debug"
-
- wc=WinConfig()
- if !(wc&1) then mode="Real"
- if wc&16 then mode="Standard"
- if wc&32 then mode="Enhanced"
-
- if wc&2 then cpu=286
- if wc&4 then cpu=386
- if wc&8 then cpu=486
- if wc&64 then cpu=8086
- if wc&128 then cpu=80186
-
- Sysinfo=strcat(cpu,' ',mode,' ',wintype,' Windows ',WinVersion(1),'.',WinVersion(0),CR)
-
- math="No math"
- if wc&1024 then math="Math"
- mouse="No Mouse"
- if WinMetrics(19) then mouse="Mouse"
-
- Sysinfo=strcat(sysinfo,math," co-processor. ",mouse,' available.',CR)
-
- sysinfo=strcat(sysinfo,WinMetrics(0),'x',WinMetrics(1)," video resolution. ",WinMetrics(-1)," colors.",CR)
-
- ErrorMode(@OFF)
- LastError()
- PlayMedia("Status WaveForm Ready")
- ErrorMode(@CANCEL)
- if LastError()!=1193 then sysinfo=strcat(sysinfo,"Windows multimedia extensions present.",CR)
-
- bug=NetGetCaps(2)
- if bug==0 then math="No n"
- if bug!=0 then math="N"
- if bug==256 then math="Microsoft n"
- if bug==512 then math="Lan Manager n"
- if bug==768 then math="Novell NetWare n"
- if bug==1024 then math="Banyan Vines n"
- if bug==1280 then math="10 Net n"
- sysinfo=strcat(sysinfo,math,"etwork installed.",CR)
-
- bug=WinResources(0)/1024 ; Compute memory avail
- math=strlen(bug)
- if math>3 then bug=strcat(strsub(bug,1,math-3),',',strsub(bug,math-2,3))
-
- sysinfo=strcat(sysinfo,CR,bug," KB Free Memory",CR)
- sysinfo=strcat(sysinfo,WinResources(2),"%% System Resources Free (",WinResources(3),"%% GDI, ",WinResources(4),"%% User)",CR)
-
- sysinfo=strcat(sysinfo,"DOS ",DosVersion(1),'.',DosVersion(0)," using ",environment("COMSPEC"),CR)
- disks=DiskScan(1)
- if disks!="" then sysinfo=strcat(sysinfo,"Floppies ",disks,CR)
- disks=DiskScan(2)
- if disks!="" then sysinfo=strcat(sysinfo,"Hard Disks ",disks,CR)
- disks=DiskScan(4)
- if disks!="" then sysinfo=strcat(sysinfo,"Network Disks ",disks,CR)
- sysinfo=strcat(sysinfo,"Windows Directory ",DirWindows(0),CR)
- sysinfo=strcat(sysinfo,"System Directory ",DirWindows(1),CR)
- sysinfo=strcat(sysinfo,CR,"WIL Interpreter Ver ",VersionDll())
-
- ver=Version()
- Message("File Commander %ver% SysInfo",Sysinfo)
-